﻿<views:SocialView
    x:Class="SpaceNeedle.x6473.WindowsPhone.Views.Social"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:views="clr-namespace:SpaceNeedle.x6473.WindowsPhone.Views"
    xmlns:controls="clr-namespace:SpaceNeedle.x6473.WindowsPhone.Controls"
    xmlns:viewmodels="clr-namespace:SpaceNeedle.x6473.WindowsPhone.ViewModels"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True" shell:SystemTray.Opacity="0">

    <!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot">
        <phone:Panorama x:Name="panorama" Title="{Binding StaticContent.SocialTitle}">

            <!--Panorama item one-->
            <phone:PanoramaItem Header="{Binding StaticContent.FacebookSectionTitle}">
                <ListBox x:Name="facebookPostsListBox" ItemsSource="{Binding FacebookPosts}" SelectionChanged="OnFacebookPostsListBox_SelectionChanged">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Margin="24,0,0,0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top">
                                <Image Source="{Binding Thumbnail}" Width="130" Stretch="Uniform" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,6,0,0" />
                                <TextBlock TextWrapping="Wrap" Width="200" Height="100" Margin="10,0,0,0" Tag="{Binding}" Text="{Binding Text}" FontSize="20" HorizontalAlignment="Left" VerticalAlignment="Top" FontFamily="Portable User Interface" TextTrimming="WordEllipsis"></TextBlock>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </phone:PanoramaItem>

            <!--Panorama item two-->
            <phone:PanoramaItem Header="{Binding StaticContent.TwitterSectionTitle}">
                <ListBox x:Name="twitterPostsListBox" ItemsSource="{Binding TwitterPosts}" SelectionChanged="OnTwitterPostsListBox_SelectionChanged">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Margin="15,0,0,0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top">
                                <StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,20,0,0">
                                    <!--<Image Source="/Assets/Social/Twitter-Logo.png"  Margin="0,0,0,0" Width="40" Height="40" HorizontalAlignment="Left" />-->
                                    <TextBlock Text="{Binding TwitterPost}" Width="300" Height="100" FontSize="20" TextWrapping="Wrap" TextTrimming="WordEllipsis" />
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </phone:PanoramaItem>
        </phone:Panorama>
        <ProgressBar Visibility="{Binding IsInProgress, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource ProgressStyle}" VerticalAlignment="Top" Margin="0" />
        <controls:NewtworkStatusControl/>

    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar Mode="Minimized" Opacity="1.0" IsMenuEnabled="True" IsVisible="True">
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="uploadsMenuItem" Text="uploads" Click="OnUploadsMenuItem_Click"/>
                <shell:ApplicationBarMenuItem x:Name="aboutMenuItem" Text="sobre" Click="OnAboutMenuItem_Click"/>
                <shell:ApplicationBarMenuItem x:Name="signoutMenuItem" Text="sair" Click="OnSignOutMenuItem_Click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</views:SocialView>